package com.wuyou.designPatterns.facade;

import cn.hutool.core.date.format.DateBasic;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Date;
import java.util.Properties;

/**
 * Database
 *
 * @Date 2024/10/14 14:24
 * @Author 无忧
 */
public class Database {

    private Database(){}

    public static Properties getProperties(String dbname){
        String filename = System.getProperty("user.dir") + File.separator + "src" + File.separator + "main" + File.separator + "java" + File.separator + Database.class.getPackage().getName().replace(".", File.separator) + File.separator + dbname + ".txt";
        Properties prop = new Properties();
        try {
            FileInputStream inStream = new FileInputStream(filename);
            prop.load(inStream);
        } catch (IOException e) {
            System.out.println("Warning: " + filename + " is not find.");
        }
        return prop;
    }
}
